import 'dart:async';

import 'package:flutter/services.dart';

class FlutterBubble {
  static const MethodChannel _channel = const MethodChannel('flutter_bubble');

  static Future<String> get platformVersion async {
    final String version = await _channel.invokeMethod('getPlatformVersion');
    return version;
  }

  /// 显示悬浮球
  static Future<bool> showBubble() async {
    final bool result = await _channel.invokeMethod('showBubble');
    return result;
  }

  /// 隐藏悬浮球
  static Future<bool> hideBubble() async {
    final bool result = await _channel.invokeMethod('hideBubble');
    return result;
  }

  /// 检查悬浮窗权限
  static Future<bool> checkPermission() async {
    final bool result = await _channel.invokeMethod('checkPermission');
    return result;
  }

  /// 请求悬浮窗权限
  static Future<bool> requestPermission() async {
    final bool result = await _channel.invokeMethod('requestPermission');
    return result;
  }
}
